/**
 * 
 */
package org.mspring.mlog.web.module.web.ucenter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.mspring.mlog.entity.security.User;
import org.mspring.mlog.service.security.UserService;
import org.mspring.mlog.support.resolver.SpaceUser;
import org.mspring.platform.web.freemarker.widget.stereotype.Widget;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Gao Youbo
 * @since 2013-6-7
 * @description
 * @TODO
 */
@Widget
@RequestMapping("/u")
public class UCenter_IndexWidget extends AbstractUCenterWidget {

    @Autowired
    private UserService userService;

    @RequestMapping("/{username}")
    public String index(@SpaceUser(pathVariable = "username") User user, HttpServletRequest request, HttpServletResponse response, Model model) {
        if (user == null) {
            return "skin:/errors/404";
        }
        return "skin:/ucenter/index";
    }

}
